<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生成验证码图片</title>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        $.(function () {
            $.ajax({
                url:'/imgcode' ,
                dataType: 'json',
                method: 'GET',
                success: function(data) {
                    if (data.result == 1) {
                        $('.box').html('<div>测试</div>');
                    }
                },
             error: function(xhr) {
                 // 导致出错的原因较多，以后再研究
                    alert('error:' + JSON.stringify(xhr));
                }
            })
        })
    </script>
</head>
<body>
    <div class="box"></div>
</body>
</html>